<script type="text/javascript">
var player = '';
$(document).ready(function(){
	AudioPlayer.setup("<?=JS_URL?>/audio-player/player.swf", {  
            width: 250,
            transparentpagebg: "yes"
        });  
		
	$('.video-fancy').fancybox({
		onStart: function(e){
			player = e.attr('rel');
		},
		onClosed: function(e){
			if(player != ''){
				jwplayer(player).stop();
				player = '';
			}
		}
	});	
})
	
</script>
<input type="hidden" value="<?=$start?>" id="start" />
<div class="content_table_load">
	<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table-up">

	</table>

	<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table-under">
		<tr class="tr-top">
			<th class="th_no_cursor" id="column_header_number">No.</th>
			<th class="td_no_padd" id="column_header_checkbox"><input type="checkbox" class="custom_chk" id="selectAllItems" onclick="selectAllItems(<?=count($result)?>)" /></th>

			<?php
			$this->load->view('BACKEND/ajax_loadContent_body',array('body_type'=>CONTENT_BODY_TYPE_HEADER));
			if(!empty($list_view_created_show)){
			?>
			<th class="th_center" id="column_header_created" onclick="sort('created')"><div id="created" class="sort icon_sort_asc">Created</div></th>
			<?php
			}
			if(!empty($list_view_status_show)){
			?>
			<th id="column_header_status" onclick="sort('status')"><div id="status" class="sort icon_no_sort">Status</div></th>
			<?php
			}
			?>
			<th id="column_header_action" class="th_last">Action</th>
		</tr>
		<?php
		if($result){
			$i=0;
			foreach($result as $k=>$v){
		?>
			<tr class="item_row<?=$i?> <?php ($k%2==0) ? print 'row1' : print 'row2' ?>">
				<td class="td_center"><?=$k+1+$start?></td>
				<td class="td_no_padd"><input type="checkbox" class="custom_chk" id="item<?=$i?>" onclick="selectItem(<?=$i?>)" value="<?=$v->id?>" /></td>
				<?php
				$this->load->view('BACKEND/ajax_loadContent_body',array('body_type'=>CONTENT_BODY_TYPE_ITEM,'v'=>$v));
				if(!empty($list_view_created_show)){
				?>
				<td class="td_center"><?=date('d-m-Y',strtotime($v->created))?></td>
				<?php
				}
				if($module!='manager_modules'){
					if(!empty($list_view_status_show)){
				?>
				<td class="td_center" id="loadStatusID_<?=$v->id?>"><a href="javascript:void(0)" onclick="updateStatus(<?=$v->id?>,<?=$v->$status_name?>,'<?=$module?>')"><img alt="Checked item" src="<?=PATH_URL.'static/images/admin/icons/'?><?php ($v->$status_name==0) ? print 'uncheck_16x16.png' : print 'check_16x16.png' ?>" /></a></td>
				<?php 
					}
				} else {
				?>
				<td class="td_center" id="loadStatusID_<?=$v->id?>"><a href="javascript:void(0)" onclick="updateStatus(<?=$v->id?>,<?=$v->$status_name?>,'<?=$module?>')"><?php ($v->$status_name==0) ? print 'Install' : print 'Uninstall' ?></a></td>
				<?php 
				}
				?>
				<td class="th_last">
					<?php
					$this->load->view('BACKEND/ajax_loadContent_action',array('v'=>$v));
					?>
					<div style="width:auto;float:left;"><a href="<?=PATH_URL.'admincp/'.$module.'/update/'.$v->id?>" class="button">EDIT</a></div>
					<div style="width:auto;float:left;"><a href="javascript:void(0)" onclick="deleteItem(<?=$v->id?>)" class="button">DELETE</a></div>
				</td>
			</tr>
		<?php
				$i++;
			}
		} else {
		?>
		<tr class="row1">
			<td class="th_last td_center" colspan="50" style="font-size: 20px; padding: 50px 0">No data</td>
		</tr>
		<?php
		}
		?>
	</table>
</div>
<div class="clearAll"></div>
